﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Taobao.Common
{
    public static class Util
    {
        public static T ChangeType<T>(string value, T defaultValue)
        {
            var result = defaultValue;
            try
            {
                result = (T)Convert.ChangeType(value, typeof(T));
            }
            catch
            {
                result = defaultValue;
            }
            return result;
        }
    }
}
